/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Mapper;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author Quang Thao
 */
public class Book_StateMapper extends DBMapper {

    public Book_StateMapper() throws SQLException, Exception {
        super();
    }

    public Bean.Book_StateBean GetInfo(String id) throws Exception {
        PreparedStatement stmt = getConnection().prepareStatement("SELECT * FROM Book_State WHERE ID='" + id + "'");
        ResultSet rs = stmt.executeQuery();
        Bean.Book_StateBean bs = null;
        if (rs != null && rs.next()) {
            bs = new Bean.Book_StateBean();
            bs.setID(rs.getString(1));
            bs.setState(rs.getString(2));
        }
        stmt.close();
        return bs;
    }
}
